package com.example.jjyu.controller;



import com.example.jjyu.entity.Feedback;
import com.example.jjyu.entity.Result;
import com.example.jjyu.service.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/feedback")
public class FeedbackController {

    @Autowired
    private FeedbackService feedbackService;

    @PostMapping("/add")
    public Result addFeedback(@RequestBody Feedback feedback) {
        if (feedbackService.save(feedback)) {
            return Result.success();
        }
        return Result.error("添加失败");
    }
}